﻿/*
COPYRIGHT (C) 2011-2013 Raynald Messié

THIS FILE IS PART OF SCRUMPILOT.

SCRUMPILOT IS FREE SOFTWARE: YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF 
THE GNU LESSER GENERAL PUBLIC LICENSE VERSION v2.1 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION.

SCRUMPILOT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY; WITHOUT
EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU LESSER
GENERAL PUBLIC LICENSE FOR MORE DETAILS.

YOU SHOULD HAVE RECEIVED A COPY OF THE GNU LESSER GENERAL PUBLIC LICENSE ALONG WITH SCRUMPILOT. 
IF NOT, SEE <HTTP://WWW.GNU.ORG/LICENSES/>.
*/

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace ScrumPilot.Domain.Models
{
    public class WallInfo
    {
        public Int64 ID { get; set; }
        public string Author { get; set; }
        public Nullable<Int32> AuthorID { get; set; }
        public string Sentence { get; set; }
        public string Description { get; set; }
        public string MoreInformation { get; set; }

        public string ActionDate
        {
            get { return this.Date.ToString("f"); }
        }

        public string ISO8601Date
        {
            get { return this.Date.ToString("o"); }
        }

        public string URLDetail { get; set; }
        public DateTime Date { get; set; }
        public Nullable<Int32> ProjectID { get; set; }
        public string ProjectName { get; set; }
        public List<WallComment> Comments { get; set; }
    }

    public class WallComment
    {
        public Int64 ID { get; set; }
        public Int32 AuthorID { get; set; }
        public string Author { get; set; }

        [Required]
        public string Comment { get; set; }

        // ReSharper disable InconsistentNaming
        public DateTime date { get; set; }
        // ReSharper restore InconsistentNaming

        public string Date
        {
            get { return this.date.ToString("f"); }
        }

        public string ISO8601Date
        {
            get { return this.date.ToString("o"); }
        }

        public Boolean CanDelete { get; set; }
    }
}
